﻿using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;

namespace FrameWork.Npoi.Helper
{
    /// <summary>
    /// 导入助手
    /// </summary>
    public class ImportHelper
    {
        public static DataTable Import(string path)
        {
            try
            {
                ExcelHelper helper = new XSSFExcelHelper();
                DataTable dt = helper.ImportToDt(path);
                return dt;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                throw;
            }
        }
    }
}
